package com.luo.demo.service.impl;

//import com.luo.demo.entity.User;

import com.luo.demo.dao.UserMapper;
import com.luo.demo.entity.User;
import com.luo.demo.service.MyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MyServiceImpl implements MyService {

    @Autowired
    UserMapper userMapper;


    public User getUser(String userName, String password) {
        User user = userMapper.selectUserByUsername(userName, password);
        if(user == null){
            return null;
        } else {
            user.setUsername(userName);
            return user;
        }
    }
}
